// Action 类型
export const SET_LOGIN = 'SET_LOGIN';
export const SET_LANGUAGE = 'SET_LANGUAGE';
export const SET_THEME = 'SET_THEME';

export interface UserInfo {
  name: string;
  avatar: string;
  token: string;
}

export interface SetLoginAction {
  type: typeof SET_LOGIN;
  payload: { isLogin: boolean; userInfo: UserInfo };
}

// Action 创建函数
export const setLogin = (isLogin: boolean, userInfo: UserInfo): SetLoginAction => ({
  type: SET_LOGIN,
  payload: { isLogin, userInfo },
});
